package com.ler.yrmall.search.controller;

import com.ler.yrmall.search.request.SpuSearchRequest;
import com.ler.yrmall.search.service.SpuSearchService;
import com.ler.yrmall.basic.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Leron
 * @version 1.0
 */
@RestController
@RequestMapping("/search")
public class SearchController {

    @Resource
    private SpuSearchService spuSearchService;

    @PostMapping("/search")
    public Result<?> search(@RequestBody SpuSearchRequest request) {
        return Result.ok(spuSearchService.search(request));
    }

}
